if exists (select 1 from sysobjects where name = 'del_anstellung' and type = 'P')
begin
   drop procedure del_anstellung
   print 'Procedure: del_anstellung deleted ...'
end
go
create procedure del_anstellung(
  @anstellungid          int   = 1
)
as
begin
  set nocount on
  declare @beschrid int
   select @beschrid = BeschrID
     from Anstellung
    where AnstellungID = @anstellungid
   delete from Anstellung where BeschrID = @beschrid
     exec del_beschreibung @beschrid

end
go
print 'Procedure: del_anstellung done ...'
go
grant exec on del_anstellung to prsadmins with grant option
go
grant exec on del_anstellung to prsusers
go

